package kgc.crm.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
    * 客户表
    */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "kgc_crm_crm_customer")
public class Customer {
    @TableId(value = "customer_id", type = IdType.AUTO)
    private Integer customerId;

    /**
     * 客户名称
     */
    @TableField(value = "customer_name")
    private String customerName;

    /**
     * 跟进状态 0未跟进1已跟进
     */
    @TableField(value = "followup")
    private Integer followup;

    /**
     * 1锁定
     */
    @TableField(value = "is_lock")
    private Integer isLock;

    /**
     * 下次联系时间
     */
    @TableField(value = "next_time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date nextTime;

    /**
     * 客户来源
     */
    @TableField(value = "resource")
    private Integer resource;

    /**
     * 上级客户
     */
    @TableField(value = "parent_id")
    private Integer parentId;

    /**
     * 客户级别 1=A(重点客户) 2 = B(普通客户) 3=C(非优先客户)
     */
    @TableField(value = "industry")
    private Integer industry;

    /**
     * 客户级别
     */
    @TableField(value = "level")
    private Integer level;

    /**
     * 邮箱
     */
    @TableField(value = "email")
    private String email;

    /**
     * 成交状态 0未成交 1已成交
     */
    @TableField(value = "deal_status")
    private Integer dealStatus;

    /**
     * 手机
     */
    @TableField(value = "mobile")
    private String mobile;

    /**
     * 电话
     */
    @TableField(value = "telephone")
    private String telephone;

    /**
     * 网址
     */
    @TableField(value = "website")
    private String website;

    /**
     * 备注
     */
    @TableField(value = "remark")
    private String remark;

    /**
     * 创建人ID
     */
    @TableField(value = "create_user_id")
    private Long createUserId;

    /**
     * 负责人ID
     */
    @TableField(value = "owner_user_id")
    private Long ownerUserId;

    /**
     * 只读权限
     */
    @TableField(value = "ro_user_id")
    private String roUserId;

    /**
     * 读写权限
     */
    @TableField(value = "rw_user_id")
    private String rwUserId;

    /**
     * 省市区
     */
    @TableField(value = "address")
    private String address;

    /**
     * 定位信息
     */
    @TableField(value = "location")
    private String location;

    /**
     * 详细地址
     */
    @TableField(value = "detail_address")
    private String detailAddress;

    /**
     * 地理位置经度
     */
    @TableField(value = "lng")
    private String lng;

    /**
     * 地理位置维度
     */
    @TableField(value = "lat")
    private String lat;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private Date updateTime;

    /**
     * 批次 比如附件批次
     */
    @TableField(value = "batch_id")
    private String batchId;

    @TableField(value = "last_content")
    private String lastContent;

    @TableField(exist = false)// 是否在mp中生效
    private String  resourceValue;
    @TableField(exist = false)// 是否在mp中生效
    private String  levelValue;
    @TableField(exist = false)// 是否在mp中生效
    private String  industryValue;

    public static final String COL_CUSTOMER_ID = "customer_id";

    public static final String COL_CUSTOMER_NAME = "customer_name";

    public static final String COL_FOLLOWUP = "followup";

    public static final String COL_IS_LOCK = "is_lock";

    public static final String COL_NEXT_TIME = "next_time";

    public static final String COL_RESOURCE = "resource";

    public static final String COL_PARENT_ID = "parent_id";

    public static final String COL_INDUSTRY = "industry";

    public static final String COL_LEVEL = "level";

    public static final String COL_EMAIL = "email";

    public static final String COL_DEAL_STATUS = "deal_status";

    public static final String COL_MOBILE = "mobile";

    public static final String COL_TELEPHONE = "telephone";

    public static final String COL_WEBSITE = "website";

    public static final String COL_REMARK = "remark";

    public static final String COL_CREATE_USER_ID = "create_user_id";

    public static final String COL_OWNER_USER_ID = "owner_user_id";

    public static final String COL_RO_USER_ID = "ro_user_id";

    public static final String COL_RW_USER_ID = "rw_user_id";

    public static final String COL_ADDRESS = "address";

    public static final String COL_LOCATION = "location";

    public static final String COL_DETAIL_ADDRESS = "detail_address";

    public static final String COL_LNG = "lng";

    public static final String COL_LAT = "lat";

    public static final String COL_CREATE_TIME = "create_time";

    public static final String COL_UPDATE_TIME = "update_time";

    public static final String COL_BATCH_ID = "batch_id";

    public static final String COL_LAST_CONTENT = "last_content";


}